package Test_0814.book;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 * Dare: 2024-08-14
 * Time: 19:02
 */
/*书架：放书
功能：1.最多放几本书
     2.书架上有多少本书*/
public class BookShelf {
    private Book[] bk=new Book[10];
    private int useSize;
    //构造方法(初始化)：书架上存放了哪些书
    public  BookShelf(){
        this.bk[0]=new Book("三国演义","罗贯中",30,"小说");
        this.useSize=1;
    }
    //访问的是哪个下标下的书
    public Book getBook(int pos) {
        return bk[pos];
    }
    public void setBook(int pos,Book book) {
        this.bk[pos] = book;
    }

    public Book[] getBooks() {
        return bk;
    }
    public int getUseSize() {
        return useSize;
    }
    public void setUseSize(int useSize) {
        this.useSize = useSize;
    }
}